<template>
  <!-- 公共组件样式抽取 -->
  <div class="common-card" style="height: 171px">
    <div
      style="display: flex; justify-content: space-between; margin-top: 10px"
    >
      <div class="title" style="font-size: 25px; color: #000">
        总评论数 :
        <span style="color: #409eff; font-size: 50px">{{
          itemData.totalComments
        }}</span>
      </div>
      <!-- <el-tooltip content="全平台评论数" effect="dark" placement="bottom">
        <svg-icon size="small" icon-class="question" />
      </el-tooltip> -->
    </div>

    <!-- <div class="value" style="">
      
    </div> -->
    <div class="chart" style="margin-top: 35px; margin-bottom: 15px">
      <div class="compare-wrapper">
        <!--          上三角形-->
        <div class="compare">
          <span>同比</span>
          <span class="emphasis">{{ itemData.totalCommentsYoy }}%</span>

          <!-- <div class="increase" /> -->
        </div>
        <div class="compare">
          <span>环比</span>
          <span class="emphasis">{{ itemData.totalCommentsChain }}%</span>
          <!--          下三角形-->
          <!-- <div class="decrease" /> -->
        </div>
      </div>
    </div>
  </div>
</template>
  
<script>
// import commonCardMixin from "@/mixins/commonCardMixin";

export default {
  // 应用公共样式
  // mixins: [commonCardMixin],
  props: {
    itemData: {
      type: Object,
      default: () => {},
    },
  },
};
</script>
  
<style lang="scss" scoped>
.compare-wrapper {
  height: 100%;
  display: flex;
  flex-direction: column;
  /*垂直居中*/
  justify-content: center;

  .compare {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    /*文字大小*/
    //background: yellow;
    margin-top: 3px;
    color: #666;
  }
}
</style>
  <style scoped>
.title {
  font-size: 16px;
  color: #999;
}

.value {
  color: #000;
  margin-top: 5px;
  letter-spacing: 1px;
}

.chart {
  height: 30px;
}

.common-card {
  padding: 10px 10px;
  border: 1px solid #eee;
}

.line {
  margin: 10px 0;
  border-top: 1px solid #eee;
}

.total {
  font-size: 12px;
  color: #666;
}
</style>
  
<style lang="scss">
//强调样式
.emphasis {
  margin-left: 5px;
  color: #333;
  font-weight: 700;
}

//上三角
.increase {
  width: 0;
  height: 0;
  border-width: 3px;
  border-color: transparent transparent red transparent;
  border-style: solid;
  margin: 0 0 3px 5px;
}

//下三角
.decrease {
  width: 0;
  height: 0;
  border-width: 3px;
  border-color: green transparent transparent transparent;
  border-style: solid;
  margin: 3px 0 0 5px;
}
</style>
  